package com.smartcampusbackend.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.smartcampusbackend.model.Resource;
import com.smartcampusbackend.model.ResourceBooking;
import org.springframework.web.multipart.MultipartFile;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface ResourceService {
    
    // 资源管理
    Map<String, Object> uploadResource(Resource resource, MultipartFile file);
    Map<String, Object> updateResource(Resource resource, MultipartFile file);
    Map<String, Object> deleteResource(String id, String userId, String userRole);
    Map<String, Object> getResourceById(String id);
    IPage<Resource> getResourceList(Map<String, Object> params);
    IPage<Resource> getMyResources(String userId, Map<String, Object> params);
    IPage<Resource> getAllResources(Map<String, Object> params);
    
    // 审核管理
    Map<String, Object> reviewResource(String id, String status, String comment, String reviewerId, String reviewerName);
    IPage<Resource> getPendingResources(Map<String, Object> params);
    
    // 下载和统计
    Map<String, Object> downloadResource(String id, String userId, String userName, String ipAddress, String userAgent);
    Map<String, Object> getDownloadStatistics(String resourceId);
    
    // 搜索和分类
    IPage<Resource> searchResources(Map<String, Object> params);
    Map<String, Object> getResourceCategories();
    
    // 设备预约相关
    int createBooking(ResourceBooking booking);
    int updateBooking(ResourceBooking booking);
    int cancelBooking(Integer bookingId, Integer userId);
    List<ResourceBooking> getBookingsByUser(Integer userId);
    List<ResourceBooking> getBookingsByStatus(String status);
    List<ResourceBooking> getAllBookings();
    List<ResourceBooking> getBookingsByResourceIdAndDate(String resourceId, Date bookingDate);
    Resource getResourceByIdObj(String id);
} 